LiveUser_Admin
[ class tree: LiveUser_Admin ] [ index: LiveUser_Admin ] [ all elements ]

Source for file config.inc.php

Documentation is available at config.inc.php

  1. <?php
  2. require_once 'MDB2.php';
  3. require_once 'LiveUser/Admin.php';
  4. // Please configure the following file according to your environment
  5.  
  6. $GLOBALS['_LIVEUSER_DEBUG'= true;
  7.  
  8. $db_user 'root';
  9. $db_pass '';
  10. $db_host 'localhost';
  11. $db_name 'liveuser_test';
  12.  
  13. $dsn = "mysql://$db_user:$db_pass@$db_host/$db_name";
  14.  
  15. $db = MDB2::connect($dsn);
  16.  
  17. if (PEAR::isError($db)) {
  18.     echo $db->getMessage(' ' $db->getUserInfo();
  19.     die();
  20. }
  21.  
  22. $db->setFetchMode(MDB2_FETCHMODE_ASSOC);
  23.  
  24. $conf =
  25.     array(
  26.         'autoInit' => false,
  27.         'session'  => array(
  28.             'name'     => 'PHPSESSION',
  29.             'varname'  => 'ludata'
  30.         ),
  31.         'login' => array(
  32.             'method'   => 'post',
  33.             'username' => 'handle',
  34.             'password' => 'passwd',
  35.             'force'    => false,
  36.             'remember' => 'rememberMe'
  37.         ),
  38.         'logout' => array(
  39.             'trigger'  => 'logout',
  40.             'redirect' => '?',
  41.             'destroy'  => true,
  42.             'method' => 'get',
  43.         ),
  44.         'authContainers' => array(
  45.             array(
  46.                 'type'          => 'DB',
  47.                 'name'          => 'DB_Local',
  48.                 'loginTimeout'  => 0,
  49.                 'expireTime'    => 3600,
  50.                 'idleTime'      => 1800,
  51.                 'dsn'           => $dsn,
  52.                 'allowDuplicateHandles' => 0,
  53.                 'authTable'     => 'liveuser_users',
  54.                     'authTableCols' => array(
  55.                         'required' => array(
  56.                             'auth_user_id' => array('type' => 'text',   'name' => 'auth_user_id'),
  57.                             'handle'       => array('type' => 'text',   'name' => 'handle'),
  58.                             'passwd'       => array('type' => 'text',   'name' => 'passwd'),
  59.                         ),
  60.                         'optional' => array(
  61.                             'is_active'      => array('type' => 'boolean''name' => 'is_active'),
  62.                             'lastlogin'      => array('type' => 'timestamp''name' => 'lastlogin'),
  63.                             'owner_user_id'  => array('type' => 'integer',   'name' => 'owner_user_id'),
  64.                             'owner_group_id' => array('type' => 'integer',   'name' => 'owner_group_id')
  65.                         ),
  66.                         'custom' => array (
  67.                             'name' => array('type' => 'text',    'name' => 'name'),
  68.                             'email'      => array('type' => 'text',    'name' => 'email'),
  69.                         )
  70.                     )
  71.             )
  72.         ),
  73.         'permContainer' => array(
  74.             'type'  => 'Medium',
  75.             'alias' => array(),
  76.             'storage' => array(
  77.                 'MDB2' => array(
  78.                     'dsn' => $dsn,
  79.                     'prefix' => 'liveuser_',
  80.                     'tables' => array(),
  81.                     'fields' => array(),
  82.                 ),
  83.             ),
  84.         ),
  85.     );
  86.  
  87. $admin =LiveUser_Admin::factory($conf);
  88. $logconf = array('mode' => 0666'timeFormat' => '%X %x');
  89. $logger &Log::factory('file''liveuser_test.log''ident'$logconf);
  90. $admin->addErrorLog($logger);
  91. $admin->setAdminContainers();

Documentation generated on Mon, 11 Mar 2019 14:00:08 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.